#pragma once

#include "Widgets/Widget.h"
#include "WidgetSwitcher.m.h"

//show only one subwidget at a time
//use a subwidget pointer to determine which subwidget should be shown
RCLASS()
class WHENGINE_API RWidgetSwitcher :public RWidget
{
    ROBJECT

    

public:

    virtual void PaintSubWidgets(uint16_t& InZOrder) override;

    void SetCurrentSubWidget(RWidgetPtr InWidget);

    RWidgetPtr GetCurrentSubWidget();

    TMultiCastDelegate<> OnChildChanged;
protected:
    //this subwidget will be shown,others willbe hidden
    RWidgetWeakPtr CurrentSubWidget;

};